perm filename WORDCO.LSP[E83,JMC]2 blob
sn#724579 filedate 1983-09-03 generic text, type C, neo UTF8
COMMENT ā VALID 00002 PAGES
C REC PAGE DESCRIPTION
C00001 00001
C00002 00002 wordco.lsp[e83,jmc] LISP word counter
C00004 ENDMK
Cā;
;;;wordco.lsp[e83,jmc] LISP word counter
(defun wordcount (file)
(do ((fileob (open file))
(count 0 (add1 count))
(line 'foo (readline fileob)))
((null line) (close fileob) count)
(do ((i 1 (add1 i))
(z 'foo (getchar line i)))
((null z))
(if (and (eq z '| |) (not (eq '| | (getchar line (add1 i)))))
(setq count (add1 count))))))
(setq base (setq ibase 12))